.PdfjsAnnotationExtension_Comment_hidden {
    .CustomToolbar::after {
        display: none;
    }
}
.CustomToolbar {
    width: 100%;
    height: 72px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: auto;
    .buttons {
        display: flex;
        padding: 0;
        margin: 0;
        list-style: none;
        gap: 3px;
        user-select: none;
        li {
            align-items: center;
            height: 100%;
            text-align: center;
            border: 1px solid transparent;
            border-radius: 3px;
            color: var(--main-color);
            .ant-upload-wrapper {
                line-height: normal;
            }

            .icon {
                font-size: 18px;
                padding: 5px 10px 3px 10px;
                border-bottom: 1px solid transparent;
                opacity: 0.9;
            }

            .name {
                font-size: 14px;
                padding: 1px 10px 2px 10px;
            }
        }

        li.selected {
            border: 1px solid var(--toolbar-border-color);
            background-color: var(--toolbar-border-color);
        }

        li.disabled {
            opacity: 0.5;
        }

        li.disabled:hover {
            background-color: transparent;
        }
    }

    .splitToolbarButtonSeparator {
        height: 30px;
        margin: 0 5px;
        min-width: 1px;
    }
    .right {
        position: absolute;
        right: 10px;
    }
}

.CustomToolbar::after {
    content: '';
    display: block;
    width: 330px; /* 右边间隔 */
    height: 100%; /* 确保占位符高度和工具栏一致 */
    flex-shrink: 0; /* 防止占位符被缩小 */
}

.SignatureTool {
    margin: 0 auto;
    .show {
        display: block;
    }
    .hide {
        display: none;
    }
    &-Header {
        padding: 10px;
    }
    &-Container {
        background-color: #eee;
        border: 1px solid #ccc;
        position: relative;
        margin: 0 auto;
        input {
            background-color: transparent;
            border: none;
            margin: 0 auto;
            text-align: center;
            display: block;
            width: 100%;
            outline: none;
        }
        input::-webkit-input-placeholder {
            color: #ccc;
        }
        .konvajs-content {
            z-index: 99;
            cursor: crosshair;
        }

        &-info {
            font-size: 20px;
            z-index: 0;
            color: #ccc;
            position: absolute;
            top: 50%;
            left: 0;
            right: 0;
            transform: translateY(-50%);
            text-align: center;
        }
    }

    &-ImagePreview {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        overflow: hidden;
        position: relative;
    }
    img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
    }

    &-Toolbar {
        border: 1px solid #ccc;
        border-top: 0;
        display: flex;
        justify-content: space-between;
        margin: 0 auto;

        .colorPalette {
            display: flex;
            margin: 8px;

            .cell {
                cursor: pointer;
                width: 22px;
                height: 22px;
                margin-right: 10px;
                border-radius: 100px;
                display: flex;
                align-items: center;
                justify-content: center;
                border: 1px solid #fff;

                span {
                    width: 12px;
                    height: 12px;
                    display: inline-block;
                    border-radius: 100px;
                }
            }

            .active {
                border: 1px solid #bbb;
            }
        }

        .clear {
            padding: 8px;
            cursor: pointer;
        }

        .clear:hover {
            text-decoration: underline;
        }
    }
}

.SignaturePop {
    .ant-popover-inner {
        padding: 5px;
    }
    &-Container {
        max-height: 200px;
        overflow: auto;
    }
    ul,
    li {
        margin: 0;
        list-style: none;
        padding: 0;

        li:hover {
            background-color: #ccc;
        }
    }
    li {
        display: flex;
        margin: 5px;
        justify-content: center;
        align-items: center;
        img{
            height: 48px;
            max-width: 100px;
            overflow: clip;
            object-fit: contain;
        }
        span {
            margin-left: 5px;
            cursor: pointer;
        }
    }

    &-Toolbar {
        padding: 5px;
    }
}

.StampPop {
    width: 300px;
    .ant-popover-inner {
        padding: 10px;
    }
    &-Container {
        max-height: 200px;
        overflow: auto;
        display: flex;
        flex-wrap: wrap;
    }
    ul,
    li {
        margin: 0;
        list-style: none;
        padding: 0;
        li:hover {
            background-color: #ccc;
        }
    }
    li {
        display: flex;
        margin: 5px;
        padding: 5px;
        justify-content: center;
        align-items: center;
        border-radius: 5px;
        width: 120px;
        text-align: center;
        img{
            height: 48px;
            max-width: 100px;
            overflow: clip;
            object-fit: contain;
        }
        span {
            margin-left: 5px;
            cursor: pointer;
        }
    }
    &-Toolbar {
        padding: 5px;
    }
}

.StampTool {
    margin: 0 auto;
    &-Container {
        position: relative;
        margin: 0 auto;
        .ant-form{
            margin-top: 12px;
        }
        .ant-form-item{
            margin-bottom: 12px;
        }
        &-ImagePreview {
            background-color: #eee;
            border: 1px solid #ccc;
            overflow: auto;
            .konvajs-content {
                z-index: 99;
                margin: 0 auto;
            }
        }
        &-info {
            font-size: 20px;
            z-index: 0;
            color: #ccc;
            position: absolute;
            top: 50%;
            left: 0;
            right: 0;
            transform: translateY(-50%);
            text-align: center;
        }
    }

    &-ImagePreview {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        overflow: hidden;
        position: relative;
    }
    img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
    }

    &-Toolbar {
        border: 1px solid #ccc;
        border-top: 0;
        display: flex;
        justify-content: space-between;
        margin: 0 auto;

        .colorPalette {
            display: flex;
            margin: 8px;

            .cell {
                cursor: pointer;
                width: 22px;
                height: 22px;
                margin-right: 10px;
                border-radius: 100px;
                display: flex;
                align-items: center;
                justify-content: center;
                border: 1px solid #fff;

                span {
                    width: 12px;
                    height: 12px;
                    display: inline-block;
                    border-radius: 100px;
                }
            }

            .active {
                border: 1px solid #bbb;
            }
        }

        .clear {
            padding: 8px;
            cursor: pointer;
        }

        .clear:hover {
            text-decoration: underline;
        }
    }
}

@media all and (max-width: 1150px) {
    .CustomToolbar {
        .buttons {
            .name {
                display: none;
            }
        }
    }
    .CustomToolbar::after {
        display: none;
    }
}
@media all and (max-width: 690px) {
    .CustomToolbar {
        justify-content: flex-start;
        .buttons {
            margin-left: 5px;
            padding-right: 5px;
        }
    }
}

@media (hover: hover) {
    /* 只在支持 hover 的设备上保留 :hover 效果 */
    .CustomToolbar .buttons li:hover {
        background-color: var(--button-hover-color);
    }
}
@media (hover: none) {
    /* 在不支持 hover 的设备上，例如触屏设备，禁用 :hover 效果 */
    .CustomToolbar .buttons li:active {
        background-color: var(--button-hover-color); /* 使用 active 替代 */
    }
}
